#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

int count = 0;

void * func(void *arg){
  count++;
}


int main()
{
  pthread_t th;
  int err;
  while (1){
    err = pthread_create(&th, NULL, func, NULL);
    if (err)
	printf("%d\n",count);
    assert(!err);
  }
  err = pthread_join(th,NULL);
  assert(!err);
  return 0;
}
